home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 009a / snpd0493.zip / VIDPORT.C < prev    next >
C/C++ Source or Header  |  1993-04-05  |  744b  |  35 lines

  1. /*
  2. **  Portable PC screen functions
  3. **  Public domain by Bob Stout
  4. **  Uses SCROLL.C, also from SNIPPETS
  5. */
  6.  
  7. #include <stdio.h>
  8. #include <dos.h>
  9. #include "scrnmacs.h"         /* Also in SNIPPETS     */
  10.  
  11. void scroll(int, int, int, int, int, int, int);
  12.  
  13. #define SCROLL_UP 0
  14. #define SCROLL_DN 1
  15.  
  16. void GotoXY(int col, int row)
  17. {
  18.       union REGS regs;
  19.  
  20.       setbuf(stdout, NULL);
  21.       regs.h.dh = (unsigned)row;
  22.       regs.h.dl = (unsigned)col;
  23.       regs.h.bh = VIDPAGE;
  24.       regs.h.ah = 2;
  25.       int86(0x10, ®s, ®s);
  26. }
  27.  
  28. void ClrScrn(int vattrib)
  29. {
  30.       union REGS regs;
  31.  
  32.       scroll(SCROLL_UP, 0, vattrib, 0, 0, SCREENROWS, SCREENCOLS);
  33.       GotoXY(0, 0);                     /* Home cursor  */
  34. }
  35.